<template>
<div class="app-container">
  <div>
      <el-row :gutter="20">
        <el-col :span="3" style="text-align: right;">
          <span style="font-size: 16px;">接收人：</span>
        </el-col>
        <el-col :span="20">
          <span style="font-size: 16px;">{{temp.accepter}}&nbsp;</span>
        </el-col>
        <el-col :span="3" style="text-align: right;border-bottom: 1px solid #5a5e66;">
          <span style="font-size: 16px;">时&nbsp;&nbsp;&nbsp;间：</span>
        </el-col>
        <el-col :span="21" style="border-bottom: 1px solid #5a5e66;">
          <span style="font-size: 16px;">{{temp.sendTime}}&nbsp;</span>
        </el-col>
        <el-col :span="3" style="margin-top: 20px;text-align: right;">
          <span style="font-size: 16px;">短信模版：</span>
        </el-col>
        <el-col :span="20" style="margin-top: 20px;">
          <span style="font-size: 16px;">{{temp.templateCode}}&nbsp;</span>
        </el-col>
        <el-col :span="3" style="text-align: right;">
          <span style="font-size: 16px;">短信参数：</span>
        </el-col>
        <el-col :span="20">
          <span style="font-size: 16px;">{{temp.templateParams}}&nbsp;</span>
        </el-col>
        <el-col :span="3" style="text-align: right;">
          <span style="font-size: 16px;">短信签名：</span>
        </el-col>
        <el-col :span="20">
          <span style="font-size: 16px;">{{temp.signName}}&nbsp;</span>
        </el-col>
        <el-col :span="3" style="text-align: right; margin-top: 20px; ">
          <span style="font-size: 16px;">发送结果：</span>
        </el-col>
        <el-col :span="8" style="margin-top: 20px; ">
          <span style="font-size: 16px;" v-if="temp.result==1">发送成功&nbsp;</span>
          <span style="font-size: 16px;" v-else-if="temp.result==0">发送失败&nbsp;</span>
          <span style="font-size: 16px;" v-else>未知状态&nbsp;</span>
        </el-col>
        <el-col :span="3" style="text-align: right; margin-top: 20px; ">
          <span style="font-size: 16px;">发送次数：</span>
        </el-col>
        <el-col :span="9" style="margin-top: 20px; ">
          <span style="font-size: 16px;">{{temp.failNum}}&nbsp;</span>
        </el-col>
        <el-col :span="3" style="text-align: right;">
          <span style="font-size: 16px;">失败原因：</span>
        </el-col>
        <el-col :span="21">
          <span style="font-size: 16px;">{{temp.failDesc}}&nbsp;</span>
        </el-col>
      </el-row>

      <el-row :gutter="20" style="padding-top:20px;">
        <el-col style="text-align: right;">
          <el-button size="small" class="filter-item" @click="closeSelf">取 消</el-button>
        </el-col>
      </el-row>
  </div>
</div>
</template>

<script>
export default {
  name: 'viewAlismsNotice',
  props: ['alismsNoticeFormData'],
  data() {
    return {
      temp: {
          mesId: null,
          accepter: '',
          templateCode: '',
          templateParams: '',
          signName: '',
          result: null,
          failDesc: null,
          failNum: null,
          sendTime: null
      }
    }
  },
  mounted() {
    const detail = this.alismsNoticeFormData
    if (detail) {
        this.temp.mesId = detail.mesId
        this.temp.accepter = detail.accepter
        this.temp.templateCode = detail.templateCode
        this.temp.templateParams = detail.templateParams
        this.temp.signName = detail.signName
        this.temp.result = detail.result
        this.temp.failDesc = detail.failDesc
        this.temp.failNum = detail.failNum
        this.temp.sendTime = detail.sendTime
    }
  },
  methods: {
    closeSelf() {
      this.$emit('changeCloseDialog')
    }
  }
}
</script>

